/*
 * CoefficientSelectionException.hpp
 *
 * Copyright 2012 Fabian Wenzelmann
 *
 * This file is part of Recognition-Procedures-for-Boolean-Functions.
 *
 * Recognition-Procedures-for-Boolean-Functions is free software: you
 * can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * Recognition-Procedures-for-Boolean-Functions is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Recognition-Procedures-for-Boolean-Functions.
 *
 * If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef COEFFICIENTSELECTIONEXCEPTION_HPP_
#define COEFFICIENTSELECTIONEXCEPTION_HPP_

#include <exception>
#include <string>
#include <sstream>

#include "bfr/CoefficientType.hpp"

#include "bfr/lpbCombinatorial/TreeContext.hpp"

namespace bfr {

/**
 * Class for exception to be thrown if it is not possible to
 * choose the coefficient.
 */
class CoefficientSelectionException : public std::exception {
    public:
        /**
         * Constructor given the two values.
         *
         * Creates a message that it is not possible to choose
         * the coefficient \f$c\f$ s. t. \f$a < c < b\f$.
         *
         * @param a The first number of the inequality.
         * @param b The second number of the inequality.
         */
        CoefficientSelectionException(lpb_coefficient_t a,
                                      lpb_coefficient_t b);

        /**
         * Constructor.
         *
         * Constructs an exception given the error message string,
         * the method #what will return this error message.
         */
        CoefficientSelectionException(const std::string &m);

        /**
         * Destructor.
         */
        ~CoefficientSelectionException() throw ();

        /**
         * Return the cause of the exception.
         *
         * @return The cause of the exception.
         */
        const char* what() const throw();

    private:
        // the msg string
        std::string msg;
};

}


#endif  // COEFFICIENTSELECTIONEXCEPTION_HPP_
